package service

import (
	"week3/projectsrv/global"
	"week3/projectsrv/models"
)

func CreateOrder(order *models.Order) (*models.Order, error) {
	return order, global.DB.Create(order).Error
}
func GetOrderByOrderSn(ordersb string) (*models.Order, error) {
	order := new(models.Order)
	return order, global.DB.Where("order_sn =?", ordersb).First(order).Error
}
func SaveOrder(order *models.Order) error {
	return global.DB.Save(order).Error
}
